import {
  Button,
  Icon,
  Image as VanImage,
  Popup,
  Toast,
  Loading,
  Overlay,
  PullRefresh,
  Tabbar,
  TabbarItem,
  Search,
  Tag,
  Lazyload,
  List,
  Col,
  Row,
  Field,
  NoticeBar,
  Form,
  Picker,
  DatetimePicker,
  ImagePreview,
  RadioGroup,
  Radio,
  Checkbox,
  Empty,
  ActionSheet
} from 'vant';

const compList = [
  Button,
  Icon,
  VanImage,
  Popup,
  Toast,
  Loading,
  Overlay,
  PullRefresh,
  Tabbar,
  TabbarItem,
  Search,
  Tag,
  Lazyload,
  List,
  Col,
  Row,
  Field,
  NoticeBar,
  Picker,
  DatetimePicker,
  Form,
  ImagePreview,
  RadioGroup,
  Radio,
  Checkbox,
  Empty,
  ActionSheet
];

export function registerGlobComp(app) {
  app.config.isCustomElement = (tag) => tag.startsWith('wx-open-');

  compList.forEach((comp) => {
    app.use(comp);
  });
}
